import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {},
  getters: {},
  mutations: {
    logout() {
      window.localStorage.removeItem("username");
    },
    login(state, username) {
      window.localStorage.setItem("username", username);
    },
    saveToken(state, token) {
      window.localStorage.setItem("token", token);
    },
    removeToken() {
      window.localStorage.removeItem("token");
    },
  },
  actions: {},
  modules: {},
});
